<?php
$this->LoadHelper('MemberHelper');
$MemberHelper = new MemberHelper();

$data['u_name'] = empty($this->Param['u_name']) ? ErrorMsg::Debug('请输入用户名') : $this->Param['u_name'];
$data['u_password'] = empty($this->Param['u_password']) ? ErrorMsg::Debug('请输入密码') : $this->Param['u_password'];
(!preg_match('/[0-9]/', $data['u_password'])||!preg_match('/[a-zA-Z]/', $data['u_password']) || strlen($data['u_password'])<6) ? ErrorMsg::ApiMsg('您的密码过于简单，请通过您预留的手机号码重新设置新的密码。敬请谅解！') : $this->Param['u_password'];
$MemberHelper = new MemberHelper();
$status = $MemberHelper->doLogin($data);
$member_info = $MemberHelper->getMemberRow(array('`u_name` =?' =>$data['u_name'],'`u_status` =?' => 'ok'));
$role_arr = array(1,4,6,15);
if ($status['success']) {
	if(in_array($member_info['u_role'],$role_arr)){
    	ErrorMsg::Debug('登录成功', true, '/order/pendinglist');
	}else{
		ErrorMsg::Debug('登录成功', true, '/index/index');
	}
} else {
    ErrorMsg::Debug($status['msg']);
}